﻿// Copyright (C) 2009 Monadsphere <monadshpere@gmail.com>
//
// This file is part of Monadsphere.
//
// Monadsphere is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Monadsphere is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Monadsphere. If not, see <http://www.gnu.org/licenses/>.

using System;

using monadsphere.js;
using monadsphere.dom;
using monadsphere.dom.events;
using monadsphere.dom.css;

/// <summary>
/// This package implements all interfaces in DOM Level 2 Html Specification.
/// See http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/ for details.
/// </summary>

namespace monadsphere.dom.html2 {

    [AttributeUsage(AttributeTargets.Class)]
    public class TagAttribute: Attribute {

        public TagAttribute(string tag) {
            this.tag = tag;
        }

        public TagAttribute(string tag, string type) {
            this.tag = tag;
            this.type = type;
        }

        public string tag {
            get;
            set;
        }

        public string type {
            get;
            set;
        }
    }

    public class HTMLCollection: JSVar {
        public JSNumber length {
            get {
                return getProperty<JSNumber>("length");
            }
        }

        public Node item(JSNumber index) {
            return callFunction<Node>("item", index);
        }

        public Node this[JSNumber index] {
            get {
                return getIndex<Node>(index);
            }
        }

        public Node namedItem(JSString name) {
            return callFunction<Node>("namedItem", name);
        }

        public Node this[JSString name] {
            get {
                return getIndex<Node>(name);
            }
        }
    }

    public class HTMLOptionsCollection: JSVar {
        public JSNumber length {
            get {
                return getProperty<JSNumber>("length");
            }
            set {
                setProperty("length", value);
            }
        }

        public Node item(JSNumber index) {
            return callFunction<Node>("item", index);
        }

        public Node this[JSNumber index] {
            get {
                return getIndex<Node>(index);
            }
        }

        public Node namedItem(JSString name) {
            return callFunction<Node>("namedItem", name);
        }

        public Node this[JSString name] {
            get {
                return getIndex<Node>(name);
            }
        }
    }

    public class HTMLDocument: Document {

        private static HTMLDocument theInstance = new HTMLDocument();

        /// <summary>
        /// Non-standard.
        /// </summary>
        public static HTMLDocument instance {
            get {
                return theInstance;
            }
        }

        public HTMLDocument() {
            name = "document";
        }

        public JSString title {
            get {
                return getProperty<JSString>("title");
            }
            set {
                setProperty("title", value);
            }
        }

        public JSString referrer {
            get {
                return getProperty<JSString>("referrer");
            }
        }

        public JSString domain {
            get {
                return getProperty<JSString>("domain");
            }
        }

        public JSString URL {
            get {
                return getProperty<JSString>("URL");
            }
        }

        public HTMLElement body {
            get {
                return getProperty<HTMLElement>("body");
            }
            set {
                setProperty("body", value);
            }
        }

        public HTMLCollection images {
            get {
                return getProperty<HTMLCollection>("images");
            }
        }

        public HTMLCollection applets {
            get {
                return getProperty<HTMLCollection>("applets");
            }
        }

        public HTMLCollection links {
            get {
                return getProperty<HTMLCollection>("links");
            }
        }

        public HTMLCollection forms {
            get {
                return getProperty<HTMLCollection>("forms");
            }
        }

        public HTMLCollection anchors {
            get {
                return getProperty<HTMLCollection>("anchors");
            }
        }

        public JSString cookie {
            get {
                return getProperty<JSString>("cookie");
            }
            set {
                setProperty("cookie", value);
            }
        }

        public void open() {
            callProcedure("open");
        }

        public void close() {
            callProcedure("close");
        }

        public void write(JSString text) {
            callProcedure("write", text);
        }

        public void writeln(String text) {
            callProcedure("writeln", text);
        }

        public NodeList getElementsByName(JSString elementName) {
            return callFunction<NodeList>("getElementsByName", elementName);
        }

        /// <summary>
        /// Creates a new HTMLElement based on tag info.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public T createElement<T>() where T: HTMLElement {
            Type type = typeof(T);

            object[] attr = type.GetCustomAttributes(typeof(TagAttribute), true);

            if (attr.GetLength(0) == 0) {
                throw new Exception("no tag attribute!");
            }

            TagAttribute pr = (TagAttribute) attr[0];

            T elm = callFunction<T>("createElement", new object[] { "'" + pr.tag + "'" });

            // emits type
            string t = pr.type;
            if (t != null) {
                JSContext.context.writeln(elm + ".type='" + t + "'");
            }

            return elm;
        }
    }

    public class HTMLElement: Element {

        protected HTMLElement() {
        }

        public HTMLElement(JSVar src)
            : base(src) {
        }

        public JSString id {
            get {
                return getProperty<JSString>("id");
            }
            set {
                setProperty("id", value);
            }
        }

        public JSString title {
            get {
                return getProperty<JSString>("title");
            }
            set {
                setProperty("title", value);
            }
        }

        public JSString lang {
            get {
                return getProperty<JSString>("lang");
            }
            set {
                setProperty("lang", value);
            }
        }

        public JSString dir {
            get {
                return getProperty<JSString>("dir");
            }
            set {
                setProperty("dir", value);
            }
        }

        public JSString className {
            get {
                return getProperty<JSString>("className");
            }
            set {
                setProperty("className", value);
            }
        }

        public HtmlEventHandler<EventListener<HTMLElement>> onfocus {
            set {
                this.addEventListener("focus", value.handler, value.useCapture);
            }
        }

        public HtmlEventHandler<EventListener<HTMLElement>> onblur {
            set {
                this.addEventListener("blur", value.handler, value.useCapture);
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onclick {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }
            set {
                if (value.action == -1) {
                    removeEventListener("click", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("click", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> ondblclick {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("dblclick", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("dblclick", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onmousedown {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("mousedown", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("mousedown", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onmouseup {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("mouseup", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("mouseup", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onmouseover {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("mouseover", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("mouseover", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onmousemove {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("mousemove", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("mousemove", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<MouseEventListener<HTMLElement>> onmouseout {
            get {
                return new HtmlEventHandler<MouseEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("mouseout", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("mouseout", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<KeyboardEventListener<HTMLElement>> onkeydown {
            get {
                return new HtmlEventHandler<KeyboardEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("keydown", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("keydown", value.handler, value.useCapture);
                }
            }
        }

        public HtmlEventHandler<KeyboardEventListener<HTMLElement>> onkeyup {
            get {
                return new HtmlEventHandler<KeyboardEventListener<HTMLElement>>();
            }

            set {
                if (value.action == -1) {
                    removeEventListener("keyup", value.handler, value.useCapture);
                } else if (value.action == 1) {
                    addEventListener("keyup", value.handler, value.useCapture);
                }
            }
        }

        public CSS2Properties style {
            get {
                return getProperty<CSS2Properties>("style");
            }
        }
    }

    [Tag("SUB")]
    public class HTMLSubElement: HTMLElement {
        public HTMLSubElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("SUP")]
    public class HTMLSupElement: HTMLElement {
        public HTMLSupElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("SPAN")]
    public class HTMLSpanElement: HTMLElement {
        public HTMLSpanElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("BDO")]
    public class HTMLBdoElement: HTMLElement {
        public HTMLBdoElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("TT")]
    public class HTMLTtElement: HTMLElement {
        public HTMLTtElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("I")]
    public class HTMLItalicElement: HTMLElement {
        public HTMLItalicElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("B")]
    public class HTMLBoldElement: HTMLElement {
        public HTMLBoldElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("U")]
    public class HTMLUnderlineElement: HTMLElement {
        public HTMLUnderlineElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("S")]
    public class HTMLSElement: HTMLElement {
        public HTMLSElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("STRIKE")]
    public class HTMLStrikeElement: HTMLElement {
        public HTMLStrikeElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("BIG")]
    public class HTMLBigElement: HTMLElement {
        public HTMLBigElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("SMALL")]
    public class HTMLSmallElement: HTMLElement {
        public HTMLSmallElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("EM")]
    public class HTMLEmElement: HTMLElement {
        public HTMLEmElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("STRONG")]
    public class HTMLStrongElement: HTMLElement {
        public HTMLStrongElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("DFN")]
    public class HTMLDfnElement: HTMLElement {
        public HTMLDfnElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("CODE")]
    public class HTMLCodeElement: HTMLElement {
        public HTMLCodeElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("SAMP")]
    public class HTMLSampElement: HTMLElement {
        public HTMLSampElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("KBD")]
    public class HTMLKdbElement: HTMLElement {
        public HTMLKdbElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("VAR")]
    public class HTMLVarElement: HTMLElement {
        public HTMLVarElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("CITE")]
    public class HTMLCiteElement: HTMLElement {
        public HTMLCiteElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("ACRONYM")]
    public class HTMLAcronymElement: HTMLElement {
        public HTMLAcronymElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("ABBR")]
    public class HTMLAbbrElement: HTMLElement {
        public HTMLAbbrElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("DD")]
    public class HTMLDdElement: HTMLElement {
        public HTMLDdElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("DT")]
    public class HTMLDtElement: HTMLElement {
        public HTMLDtElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("NOFRAMES")]
    public class HTMLNoFramesElement: HTMLElement {
        public HTMLNoFramesElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("NOSCRIPT")]
    public class HTMLNoScriptElement: HTMLElement {
        public HTMLNoScriptElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("ADDRESS")]
    public class HTMLAddressElement: HTMLElement {
        public HTMLAddressElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("CENTER")]
    public class HTMLCenterElement: HTMLElement {
        public HTMLCenterElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("HTML")]
    public class HTMLHtmlElement: HTMLElement {
        public HTMLHtmlElement(JSVar src)
            : base(src) {
        }

        public JSString version {
            get {
                return getProperty<JSString>("version");
            }
            set {
                setProperty("version", value);
            }
        }
    }

    [Tag("HEAD")]
    public class HTMLHeadElement: HTMLElement {
        public HTMLHeadElement(JSVar src)
            : base(src) {
        }

        public JSString profile {
            get {
                return getProperty<JSString>("profile");
            }
            set {
                setProperty("profile", value);
            }
        }
    }

    [Tag("LINK")]
    public class HTMLLinkElement: HTMLElement {
        public HTMLLinkElement(JSVar src)
            : base(src) {
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString charset {
            get {
                return getProperty<JSString>("charset");
            }
            set {
                setProperty("charset", value);
            }
        }

        public JSString href {
            get {
                return getProperty<JSString>("href");
            }
            set {
                setProperty("href", value);
            }
        }

        public JSString hreflang {
            get {
                return getProperty<JSString>("hreflang");
            }
            set {
                setProperty("hreflang", value);
            }
        }

        public JSString media {
            get {
                return getProperty<JSString>("media");
            }
            set {
                setProperty("media", value);
            }
        }

        public JSString rel {
            get {
                return getProperty<JSString>("rel");
            }
            set {
                setProperty("rel", value);
            }
        }

        public JSString rev {
            get {
                return getProperty<JSString>("rev");
            }
            set {
                setProperty("rev", value);
            }
        }

        public JSString target {
            get {
                return getProperty<JSString>("target");
            }
            set {
                setProperty("target", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }
    }

    [Tag("TITLE")]
    public class HTMLTitleElement: HTMLElement {
        public HTMLTitleElement(JSVar src)
            : base(src) {
        }

        public JSString text {
            get {
                return getProperty<JSString>("text");
            }
            set {
                setProperty("text", value);
            }
        }
    }

    [Tag("META")]
    public class HTMLMetaElement: HTMLElement {
        public HTMLMetaElement(JSVar src)
            : base(src) {
        }

        public JSString content {
            get {
                return getProperty<JSString>("content");
            }
            set {
                setProperty("content", value);
            }
        }

        public JSString httpEquiv {
            get {
                return getProperty<JSString>("httpEquiv");
            }
            set {
                setProperty("httpEquiv", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString scheme {
            get {
                return getProperty<JSString>("scheme");
            }
            set {
                setProperty("scheme", value);
            }
        }
    }

    [Tag("BASE")]
    public class HTMLBaseElement: HTMLElement {
        public HTMLBaseElement(JSVar src)
            : base(src) {
        }

        public JSString href {
            get {
                return getProperty<JSString>("href");
            }
            set {
                setProperty("href", value);
            }
        }

        public JSString target {
            get {
                return getProperty<JSString>("target");
            }
            set {
                setProperty("target", value);
            }
        }
    }

    [Tag("ISINDEX")]
    public class HTMLIsIndexElement: HTMLElement {
        public HTMLIsIndexElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString prompt {
            get {
                return getProperty<JSString>("prompt");
            }
            set {
                setProperty("prompt", value);
            }
        }

    }

    [Tag("STYLE")]
    public class HTMLStyleElement: HTMLElement {
        public HTMLStyleElement(JSVar src)
            : base(src) {
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString media {
            get {
                return getProperty<JSString>("media");
            }
            set {
                setProperty("media", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }

    }

    [Tag("BODY")]
    public class HTMLBodyElement: HTMLElement {
        public HTMLBodyElement(JSVar src)
            : base(src) {
        }

        public JSString aLink {
            get {
                return getProperty<JSString>("aLink");
            }
            set {
                setProperty("aLink", value);
            }
        }

        public JSString background {
            get {
                return getProperty<JSString>("background");
            }
            set {
                setProperty("background", value);
            }
        }

        public JSString bgColor {
            get {
                return getProperty<JSString>("bgColor");
            }
            set {
                setProperty("bgColor", value);
            }
        }

        public JSString link {
            get {
                return getProperty<JSString>("link");
            }
            set {
                setProperty("link", value);
            }
        }

        public JSString text {
            get {
                return getProperty<JSString>("text");
            }
            set {
                setProperty("text", value);
            }
        }

        public JSString vLink {
            get {
                return getProperty<JSString>("vLink");
            }
            set {
                setProperty("vLink", value);
            }
        }
    }

    [Tag("FORM")]
    public class HTMLFormElement: HTMLElement {
        public HTMLFormElement(JSVar src)
            : base(src) {
        }

        public HTMLCollection elements {
            get {
                return getProperty<HTMLCollection>("elements");
            }
        }

        public JSNumber length {
            get {
                return getProperty<JSNumber>("length");
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString acceptCharset {
            get {
                return getProperty<JSString>("acceptCharset");
            }
            set {
                setProperty("acceptCharset", value);
            }
        }

        public JSString action {
            get {
                return getProperty<JSString>("action");
            }
            set {
                setProperty("action", value);
            }
        }

        public JSString enctype {
            get {
                return getProperty<JSString>("enctype");
            }
            set {
                setProperty("enctype", value);
            }
        }

        public JSString method {
            get {
                return getProperty<JSString>("method");
            }
            set {
                setProperty("method", value);
            }
        }

        public JSString target {
            get {
                return getProperty<JSString>("target");
            }
            set {
                setProperty("target", value);
            }
        }

        public void submit() {
            callProcedure("submit");
        }

        public void reset() {
            callProcedure("reset");
        }

    }

    [Tag("SELECT")]
    public class HTMLSelectElement: HTMLElement {
        public HTMLSelectElement(JSVar src)
            : base(src) {
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
        }

        public JSNumber selectedIndex {
            get {
                return getProperty<JSNumber>("selectedIndex");
            }
            set {
                setProperty("selectedIndex", value);
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }

        public JSNumber length {
            get {
                return getProperty<JSNumber>("length");
            }
            set {
                setProperty("length", value);
            }
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public HTMLOptionsCollection options {
            get {
                return getProperty<HTMLOptionsCollection>("options");
            }
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSBoolean multiple {
            get {
                return getProperty<JSBoolean>("multiple");
            }
            set {
                setProperty("multiple", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSNumber size {
            get {
                return getProperty<JSNumber>("size");
            }
            set {
                setProperty("size", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public void add(HTMLElement element,
                        HTMLElement before) {
            callProcedure("add", element, before);
        }

        public void remove(JSNumber index) {
            callProcedure("remove", index);
        }

        public void blur() {
            callProcedure("blur");
        }

        public void focus() {
            callProcedure("focus");
        }
    }

    [Tag("OPTGROUP")]
    public class HTMLOptGroupElement: HTMLElement {
        public HTMLOptGroupElement(JSVar src)
            : base(src) {
        }
        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString label {
            get {
                return getProperty<JSString>("label");
            }
            set {
                setProperty("label", value);
            }
        }
    }

    [Tag("OPTION")]
    public class HTMLOptionElement: HTMLElement {
        public HTMLOptionElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSBoolean defaultSelected {
            get {
                return getProperty<JSBoolean>("defaultSelected");
            }
            set {
                setProperty("defaultSelected", value);
            }
        }

        public JSString text {
            get {
                return getProperty<JSString>("text");
            }
        }

        public JSNumber index {
            get {
                return getProperty<JSNumber>("index");
            }
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString label {
            get {
                return getProperty<JSString>("label");
            }
            set {
                setProperty("label", value);
            }
        }

        public JSBoolean selected {
            get {
                return getProperty<JSBoolean>("selected");
            }
            set {
                setProperty("selected", value);
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }
    }

    [Tag("INPUT")]
    public class HTMLInputElement: HTMLElement {

        public HTMLInputElement(JSVar src)
            : base(src) {
        }

        public JSString defaultValue {
            get {
                return getProperty<JSString>("defaultValue");
            }
            set {
                setProperty("defaultValue", value);
            }
        }

        public JSNumber defaultChecked {
            get {
                return getProperty<JSNumber>("defaultChecked");
            }
            set {
                setProperty("defaultChecked", value);
            }
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString accept {
            get {
                return getProperty<JSString>("accept");
            }
            set {
                setProperty("accept", value);
            }
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString alt {
            get {
                return getProperty<JSString>("alt");
            }
            set {
                setProperty("alt", value);
            }
        }

        public JSBoolean _checked {
            get {
                return getProperty<JSBoolean>("checked");
            }
            set {
                setProperty("checked", value);
            }
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSNumber maxLength {
            get {
                return getProperty<JSNumber>("maxLength");
            }
            set {
                setProperty("maxLength", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSBoolean readOnly {
            get {
                return getProperty<JSBoolean>("readOnly");
            }
            set {
                setProperty("readOnly", value);
            }
        }

        public JSNumber size {
            get {
                return getProperty<JSNumber>("size");
            }
            set {
                setProperty("size", value);
            }
        }

        public JSString src {
            get {
                return getProperty<JSString>("src");
            }
            set {
                setProperty("src", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
        }

        public JSString useMap {
            get {
                return getProperty<JSString>("useMap");
            }
            set {
                setProperty("useMap", value);
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }

        public void blur() {
            callProcedure("blur");
        }

        public void focus() {
            callProcedure("focus");
        }

        public void select() {
            callProcedure("select");
        }

        public void click() {
            callProcedure("click");
        }
    }

    [Tag("INPUT", "password")]
    public class PasswordInputElement: HTMLInputElement {
        public PasswordInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "checkbox")]
    public class CheckboxInputElement: HTMLInputElement {
        public CheckboxInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "radio")]
    public class RadioInputElement: HTMLInputElement {
        public RadioInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "submit")]
    public class SubmitInputElement: HTMLInputElement {
        public SubmitInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "reset")]
    public class ResetInputElement: HTMLInputElement {
        public ResetInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "file")]
    public class FileInputElement: HTMLInputElement {
        public FileInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "hidden")]
    public class HiddenInputElement: HTMLInputElement {
        public HiddenInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "image")]
    public class ImageInputElement: HTMLInputElement {
        public ImageInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("INPUT", "button")]
    public class ButtonInputElement: HTMLInputElement {
        public ButtonInputElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("TEXTAREA")]
    public class HTMLTextAreaElement: HTMLElement {
        public HTMLTextAreaElement(JSVar src)
            : base(src) {
        }

        public JSString defaultValue {
            get {
                return getProperty<JSString>("defaultValue");
            }
            set {
                setProperty("defaultValue", value);
            }
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSNumber cols {
            get {
                return getProperty<JSNumber>("cols");
            }
            set {
                setProperty("cols", value);
            }
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSBoolean readOnly {
            get {
                return getProperty<JSBoolean>("readOnly");
            }
            set {
                setProperty("readOnly", value);
            }
        }

        public JSNumber rows {
            get {
                return getProperty<JSNumber>("rows");
            }
            set {
                setProperty("rows", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }

        public void blur() {
            callProcedure("blur");
        }

        public void focus() {
            callProcedure("focus");
        }

        public void select() {
            callProcedure("select");
        }

    }

    [Tag("BUTTON")]
    public class HTMLButtonElement: HTMLElement {

        public HTMLButtonElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSBoolean disabled {
            get {
                return getProperty<JSBoolean>("disabled");
            }
            set {
                setProperty("disabled", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }
    }

    [Tag("LABEL")]
    public class HTMLLabelElement: HTMLElement {
        public HTMLLabelElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSString htmlFor {
            get {
                return getProperty<JSString>("htmlFor");
            }
            set {
                setProperty("htmlFor", value);
            }
        }
    }

    [Tag("FIELDSET")]
    public class HTMLFieldSetElement: HTMLElement {
        public HTMLFieldSetElement(JSVar src)
            : base(src) {
        }
        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

    }

    [Tag("LEGEND")]
    public class HTMLLegendElement: HTMLElement {
        public HTMLLegendElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }
    }

    [Tag("UL")]
    public class HTMLUListElement: HTMLElement {
        public HTMLUListElement(JSVar src)
            : base(src) {
        }

        public JSBoolean compact {
            get {
                return getProperty<JSBoolean>("compact");
            }
            set {
                setProperty("compact", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }
    }

    [Tag("OL")]
    public class HTMLOListElement: HTMLElement {
        public HTMLOListElement(JSVar src)
            : base(src) {
        }

        public JSBoolean compact {
            get {
                return getProperty<JSBoolean>("compact");
            }
            set {
                setProperty("compact", value);
            }
        }

        public JSNumber start {
            get {
                return getProperty<JSNumber>("start");
            }
            set {
                setProperty("start", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }
    }

    [Tag("DL")]
    public class HTMLDListElement: HTMLElement {
        public HTMLDListElement(JSVar src)
            : base(src) {
        }

        public JSBoolean compact {
            get {
                return getProperty<JSBoolean>("compact");
            }
            set {
                setProperty("compact", value);
            }
        }
    }

    [Tag("DIR")]
    public class HTMLDirectoryElement: HTMLElement {
        public HTMLDirectoryElement(JSVar src)
            : base(src) {
        }

        public JSBoolean compact {
            get {
                return getProperty<JSBoolean>("compact");
            }
            set {
                setProperty("compact", value);
            }
        }
    }

    [Tag("MENU")]
    public class HTMLMenuElement: HTMLElement {
        public HTMLMenuElement(JSVar src)
            : base(src) {
        }

        public JSBoolean compact {
            get {
                return getProperty<JSBoolean>("compact");
            }
            set {
                setProperty("compact", value);
            }
        }
    }

    [Tag("LI")]
    public class HTMLLIElement: HTMLElement {
        public HTMLLIElement(JSVar src)
            : base(src) {
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }

        public JSNumber value {
            get {
                return getProperty<JSNumber>("value");
            }
            set {
                setProperty("value", value);
            }
        }
    }

    [Tag("DIV")]
    public class HTMLDivElement: HTMLElement {

        protected HTMLDivElement() {
        }

        public HTMLDivElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }
    }

    [Tag("P")]
    public class HTMLParagraphElement: HTMLElement {
        public HTMLParagraphElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }
    }

    [Tag("H1")]
    public class HTMLHeadingElement: HTMLElement {
        public HTMLHeadingElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("H2")]
    public class H2Element: HTMLHeadingElement {
        public H2Element(JSVar src)
            : base(src) {
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("H3")]
    public class H3Element: HTMLHeadingElement {
        public H3Element(JSVar src)
            : base(src) {
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("H4")]
    public class H4Element: HTMLHeadingElement {
        public H4Element(JSVar src)
            : base(src) {
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("H5")]
    public class H5Element: HTMLHeadingElement {
        public H5Element(JSVar src)
            : base(src) {
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("H6")]
    public class H6Element: HTMLHeadingElement {
        public H6Element(JSVar src)
            : base(src) {
        }
    }

    [Tag("Q")]
    public class HTMLQuoteElement: HTMLElement {
        public HTMLQuoteElement(JSVar src)
            : base(src) {
        }

        public JSString cite {
            get {
                return getProperty<JSString>("cite");
            }
            set {
                setProperty("cite", value);
            }
        }
    }

    [Tag("PRE")]
    public class HTMLPreElement: HTMLElement {
        public HTMLPreElement(JSVar src)
            : base(src) {
        }

        public JSNumber width {
            get {
                return getProperty<JSNumber>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    [Tag("BR")]
    public class HTMLBRElement: HTMLElement {
        public HTMLBRElement(JSVar src)
            : base(src) {
        }

        public JSString clear {
            get {
                return getProperty<JSString>("clear");
            }
            set {
                setProperty("clear", value);
            }
        }
    }

    [Tag("BASEFONT")]
    public class HTMLBaseFontElement: HTMLElement {
        public HTMLBaseFontElement(JSVar src)
            : base(src) {
        }

        public JSString color {
            get {
                return getProperty<JSString>("color");
            }
            set {
                setProperty("color", value);
            }
        }

        public JSString face {
            get {
                return getProperty<JSString>("face");
            }
            set {
                setProperty("face", value);
            }
        }

        public JSNumber size {
            get {
                return getProperty<JSNumber>("size");
            }
            set {
                setProperty("size", value);
            }
        }
    }

    [Tag("FONT")]
    public class HTMLFontElement: HTMLElement {
        public HTMLFontElement(JSVar src)
            : base(src) {
        }

        public JSString color {
            get {
                return getProperty<JSString>("color");
            }
            set {
                setProperty("color", value);
            }
        }

        public JSString face {
            get {
                return getProperty<JSString>("face");
            }
            set {
                setProperty("face", value);
            }
        }

        public JSString size {
            get {
                return getProperty<JSString>("size");
            }
            set {
                setProperty("size", value);
            }
        }
    }

    [Tag("HR")]
    public class HTMLHRElement: HTMLElement {
        public HTMLHRElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString noShade {
            get {
                return getProperty<JSString>("noShade");
            }
            set {
                setProperty("noShade", value);
            }
        }

        public JSString size {
            get {
                return getProperty<JSString>("size");
            }
            set {
                setProperty("size", value);
            }
        }

        public JSString width {
            get {
                return getProperty<JSString>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    public class HTMLModElement: HTMLElement {
        public HTMLModElement(JSVar src)
            : base(src) {
        }

        public JSString cite {
            get {
                return getProperty<JSString>("cite");
            }
            set {
                setProperty("cite", value);
            }
        }

        public JSString dateTime {
            get {
                return getProperty<JSString>("dateTime");
            }
            set {
                setProperty("dateTime", value);
            }
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("INS")]
    public class InsElement: HTMLModElement {
        public InsElement(JSVar src)
            : base(src) {
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Tag("DEL")]
    public class DelElement: HTMLModElement {
        public DelElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("A")]
    public class HTMLAnchorElement: HTMLElement {
        public HTMLAnchorElement(JSVar src)
            : base(src) {
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSString charset {
            get {
                return getProperty<JSString>("charset");
            }
            set {
                setProperty("charset", value);
            }
        }

        public JSString coords {
            get {
                return getProperty<JSString>("coords");
            }
            set {
                setProperty("coords", value);
            }
        }

        public JSString href {
            get {
                return getProperty<JSString>("href");
            }
            set {
                setProperty("href", value);
            }
        }

        public JSString hreflang {
            get {
                return getProperty<JSString>("hreflang");
            }
            set {
                setProperty("hreflang", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString rel {
            get {
                return getProperty<JSString>("rel");
            }
            set {
                setProperty("rel", value);
            }
        }

        public JSString rev {
            get {
                return getProperty<JSString>("rev");
            }
            set {
                setProperty("rev", value);
            }
        }

        public JSString shape {
            get {
                return getProperty<JSString>("shape");
            }
            set {
                setProperty("shape", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString target {
            get {
                return getProperty<JSString>("target");
            }
            set {
                setProperty("target", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }

        public void blur() {
            callProcedure("blur");
        }

        public void focus() {
            callProcedure("focus");
        }

    }

    [Tag("IMG")]
    public class HTMLImageElement: HTMLElement {
        public HTMLImageElement(JSVar src)
            : base(src) {
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString alt {
            get {
                return getProperty<JSString>("alt");
            }
            set {
                setProperty("alt", value);
            }
        }

        public JSString border {
            get {
                return getProperty<JSString>("border");
            }
            set {
                setProperty("border", value);
            }
        }

        public JSNumber height {
            get {
                return getProperty<JSNumber>("height");
            }
            set {
                setProperty("height", value);
            }
        }

        public JSNumber hspace {
            get {
                return getProperty<JSNumber>("hspace");
            }
            set {
                setProperty("hspace", value);
            }
        }

        public JSBoolean isMap {
            get {
                return getProperty<JSBoolean>("isMap");
            }
            set {
                setProperty("isMap", value);
            }
        }

        public JSString longDesc {
            get {
                return getProperty<JSString>("longDesc");
            }
            set {
                setProperty("longDesc", value);
            }
        }

        public JSString src {
            get {
                return getProperty<JSString>("src");
            }
            set {
                setProperty("src", value);
            }
        }

        public JSString useMap {
            get {
                return getProperty<JSString>("useMap");
            }
            set {
                setProperty("useMap", value);
            }
        }

        public JSNumber vspace {
            get {
                return getProperty<JSNumber>("vspace");
            }
            set {
                setProperty("vspace", value);
            }
        }

        public JSNumber width {
            get {
                return getProperty<JSNumber>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    [Tag("OBJECT")]
    public class HTMLObjectElement: HTMLElement {
        public HTMLObjectElement(JSVar src)
            : base(src) {
        }

        public HTMLFormElement form {
            get {
                return getProperty<HTMLFormElement>("form");
            }
        }

        public JSString code {
            get {
                return getProperty<JSString>("code");
            }
            set {
                setProperty("code", value);
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString archive {
            get {
                return getProperty<JSString>("archive");
            }
            set {
                setProperty("archive", value);
            }
        }

        public JSString border {
            get {
                return getProperty<JSString>("border");
            }
            set {
                setProperty("border", value);
            }
        }

        public JSString codeBase {
            get {
                return getProperty<JSString>("codeBase");
            }
            set {
                setProperty("codeBase", value);
            }
        }

        public JSString codeType {
            get {
                return getProperty<JSString>("codeType");
            }
            set {
                setProperty("codeType", value);
            }
        }

        public JSString data {
            get {
                return getProperty<JSString>("data");
            }
            set {
                setProperty("data", value);
            }
        }

        public JSBoolean declare {
            get {
                return getProperty<JSBoolean>("declare");
            }
            set {
                setProperty("declare", value);
            }
        }

        public JSString height {
            get {
                return getProperty<JSString>("height");
            }
            set {
                setProperty("height", value);
            }
        }

        public JSNumber hspace {
            get {
                return getProperty<JSNumber>("hspace");
            }
            set {
                setProperty("hspace", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString standby {
            get {
                return getProperty<JSString>("standby");
            }
            set {
                setProperty("standby", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }

        public JSString useMap {
            get {
                return getProperty<JSString>("useMap");
            }
            set {
                setProperty("useMap", value);
            }
        }

        public JSNumber vspace {
            get {
                return getProperty<JSNumber>("vspace");
            }
            set {
                setProperty("vspace", value);
            }
        }

        public JSString width {
            get {
                return getProperty<JSString>("width");
            }
            set {
                setProperty("width", value);
            }
        }

        public Document contentDocument {
            get {
                return getProperty<Document>("contentDocument");
            }
        }

    }

    [Tag("PARAM")]
    public class HTMLParamElement: HTMLElement {
        public HTMLParamElement(JSVar src)
            : base(src) {
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }

        public JSString value {
            get {
                return getProperty<JSString>("value");
            }
            set {
                setProperty("value", value);
            }
        }

        public JSString valueType {
            get {
                return getProperty<JSString>("valueType");
            }
            set {
                setProperty("valueType", value);
            }
        }
    }

    [Tag("APPLET")]
    public class HTMLAppletElement: HTMLElement {
        public HTMLAppletElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString alt {
            get {
                return getProperty<JSString>("alt");
            }
            set {
                setProperty("alt", value);
            }
        }

        public JSString archive {
            get {
                return getProperty<JSString>("archive");
            }
            set {
                setProperty("archive", value);
            }
        }

        public JSString code {
            get {
                return getProperty<JSString>("code");
            }
            set {
                setProperty("code", value);
            }
        }

        public JSString codeBase {
            get {
                return getProperty<JSString>("codeBase");
            }
            set {
                setProperty("codeBase", value);
            }
        }

        public JSString height {
            get {
                return getProperty<JSString>("height");
            }
            set {
                setProperty("height", value);
            }
        }

        public JSNumber hspace {
            get {
                return getProperty<JSNumber>("hspace");
            }
            set {
                setProperty("hspace", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString _object {
            get {
                return getProperty<JSString>("object");
            }
            set {
                setProperty("object", value);
            }
        }

        public JSNumber vspace {
            get {
                return getProperty<JSNumber>("vspace");
            }
            set {
                setProperty("vspace", value);
            }
        }

        public JSNumber width {
            get {
                return getProperty<JSNumber>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    [Tag("MAP")]
    public class HTMLMapElement: HTMLElement {
        public HTMLMapElement(JSVar src)
            : base(src) {
        }

        public HTMLCollection areas {
            get {
                return getProperty<HTMLCollection>("areas");
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }
    }

    [Tag("AREA")]
    public class HTMLAreaElement: HTMLElement {
        public HTMLAreaElement(JSVar src)
            : base(src) {
        }

        public JSString accessKey {
            get {
                return getProperty<JSString>("accessKey");
            }
            set {
                setProperty("accessKey", value);
            }
        }

        public JSString alt {
            get {
                return getProperty<JSString>("alt");
            }
            set {
                setProperty("alt", value);
            }
        }

        public JSString coords {
            get {
                return getProperty<JSString>("coords");
            }
            set {
                setProperty("coords", value);
            }
        }

        public JSString href {
            get {
                return getProperty<JSString>("href");
            }
            set {
                setProperty("href", value);
            }
        }

        public JSBoolean noHref {
            get {
                return getProperty<JSBoolean>("noHref");
            }
            set {
                setProperty("noHref", value);
            }
        }

        public JSString shape {
            get {
                return getProperty<JSString>("shape");
            }
            set {
                setProperty("shape", value);
            }
        }

        public JSNumber tabIndex {
            get {
                return getProperty<JSNumber>("tabIndex");
            }
            set {
                setProperty("tabIndex", value);
            }
        }

        public JSString target {
            get {
                return getProperty<JSString>("target");
            }
            set {
                setProperty("target", value);
            }
        }
    }

    [Tag("SCRIPT")]
    public class HTMLScriptElement: HTMLElement {
        public HTMLScriptElement(JSVar src)
            : base(src) {
        }

        public JSString text {
            get {
                return getProperty<JSString>("text");
            }
            set {
                setProperty("text", value);
            }
        }

        public JSString htmlFor {
            get {
                return getProperty<JSString>("htmlFor");
            }
            set {
                setProperty("htmlFor", value);
            }
        }

        public JSString _event {
            get {
                return getProperty<JSString>("event");
            }
            set {
                setProperty("event", value);
            }
        }

        public JSString charset {
            get {
                return getProperty<JSString>("charset");
            }
            set {
                setProperty("charset", value);
            }
        }

        public JSBoolean defer {
            get {
                return getProperty<JSBoolean>("defer");
            }
            set {
                setProperty("defer", value);
            }
        }

        public JSString src {
            get {
                return getProperty<JSString>("src");
            }
            set {
                setProperty("src", value);
            }
        }

        public JSString type {
            get {
                return getProperty<JSString>("type");
            }
            set {
                setProperty("type", value);
            }
        }
    }

    [Tag("TABLE")]
    public class HTMLTableElement: HTMLElement {
        public HTMLTableElement(JSVar src)
            : base(src) {
        }

        public HTMLTableCaptionElement caption {
            get {
                return getProperty<HTMLTableCaptionElement>("caption");
            }
            set {
                setProperty("caption", value);
            }
        }

        public HTMLTableSectionElement tHead {
            get {
                return getProperty<HTMLTableSectionElement>("tHead");
            }
            set {
                setProperty("tHead", value);
            }
        }

        public HTMLTableSectionElement tFoot {
            get {
                return getProperty<HTMLTableSectionElement>("tFoot");
            }
            set {
                setProperty("tFoot", value);
            }
        }

        public HTMLCollection rows {
            get {
                return getProperty<HTMLCollection>("rows");
            }
        }

        public HTMLCollection tBodies {
            get {
                return getProperty<HTMLCollection>("tBodies");
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString bgColor {
            get {
                return getProperty<JSString>("bgColor");
            }
            set {
                setProperty("bgColor", value);
            }
        }

        public JSString border {
            get {
                return getProperty<JSString>("border");
            }
            set {
                setProperty("border", value);
            }
        }

        public JSString cellPadding {
            get {
                return getProperty<JSString>("cellPadding");
            }
            set {
                setProperty("cellPadding", value);
            }
        }

        public JSString cellSpacing {
            get {
                return getProperty<JSString>("cellSpacing");
            }
            set {
                setProperty("cellSpacing", value);
            }
        }

        public JSString frame {
            get {
                return getProperty<JSString>("frame");
            }
            set {
                setProperty("frame", value);
            }
        }

        public JSString rules {
            get {
                return getProperty<JSString>("rules");
            }
            set {
                setProperty("rules", value);
            }
        }

        public JSString summary {
            get {
                return getProperty<JSString>("summary");
            }
            set {
                setProperty("summary", value);
            }
        }

        public JSNumber width {
            get {
                return getProperty<JSNumber>("width");
            }
            set {
                setProperty("width", value);
            }
        }

        public HTMLElement createTHead() {
            return callFunction<HTMLElement>("createTHead");
        }

        public void deleteTHead() {
            callProcedure("deleteTHead");
        }

        public HTMLElement createTFoot() {
            return callFunction<HTMLElement>("createTFoot");
        }

        public void deleteTFoot() {
            callProcedure("deleteTFoot");
        }

        public HTMLElement createCaption() {
            return callFunction<HTMLElement>("createCaption");
        }

        public void deleteCaption() {
            callProcedure("deleteCaption");
        }

        public HTMLElement insertRow(JSNumber index) {
            return callFunction<HTMLElement>("insertRow", index);
        }

        public void deleteRow(int index) {
            callProcedure("deleteRow");
        }
    }

    [Tag("CAPTION")]
    public class HTMLTableCaptionElement: HTMLElement {
        public HTMLTableCaptionElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }
    }

    [Tag("COL")]
    public class HTMLTableColElement: HTMLElement {
        public HTMLTableColElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString ch {
            get {
                return getProperty<JSString>("ch");
            }
            set {
                setProperty("ch", value);
            }
        }

        public JSString chOff {
            get {
                return getProperty<JSString>("chOff");
            }
            set {
                setProperty("chOff", value);
            }
        }

        public JSNumber span {
            get {
                return getProperty<JSNumber>("span");
            }
            set {
                setProperty("span", value);
            }
        }

        public JSString vAlign {
            get {
                return getProperty<JSString>("vAlign");
            }
            set {
                setProperty("vAlign", value);
            }
        }

        public JSString width {
            get {
                return getProperty<JSString>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    public class HTMLTableSectionElement: HTMLElement {
        public HTMLTableSectionElement(JSVar src)
            : base(src) {
        }
        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString ch {
            get {
                return getProperty<JSString>("ch");
            }
            set {
                setProperty("ch", value);
            }
        }

        public JSString vAlign {
            get {
                return getProperty<JSString>("vAlign");
            }
            set {
                setProperty("vAlign", value);
            }
        }

        public HTMLCollection rows {
            get {
                return getProperty<HTMLCollection>("rows");
            }
        }

        public HTMLElement insertRow(JSNumber index) {
            return callFunction<HTMLElement>("insertRow", index);
        }

        public void deleteRow(JSNumber index) {
            callFunction<HTMLElement>("deleteRow", index);
        }
    }

    [Tag("THEAD")]
    public class THeadElement: HTMLTableSectionElement {
        public THeadElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("TFOOT")]
    public class TFootElement: HTMLTableSectionElement {
        public TFootElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("TBODY")]
    public class TBodyElement: HTMLTableSectionElement {
        public TBodyElement(JSVar src)
            : base(src) {
        }
    }

    [Tag("TR")]
    public class HTMLTableRowElement: HTMLElement {
        public HTMLTableRowElement(JSVar src)
            : base(src) {
        }

        public JSNumber rowIndex {
            get {
                return getProperty<JSNumber>("rowIndex");
            }
        }

        public JSNumber sectionRowIndex {
            get {
                return getProperty<JSNumber>("sectionRowIndex");
            }
        }

        public HTMLCollection cells {
            get {
                return getProperty<HTMLCollection>("cells");
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString bgColor {
            get {
                return getProperty<JSString>("bgColor");
            }
            set {
                setProperty("bgColor", value);
            }
        }

        public JSString ch {
            get {
                return getProperty<JSString>("ch");
            }
            set {
                setProperty("ch", value);
            }
        }

        public JSString chOff {
            get {
                return getProperty<JSString>("chOff");
            }
            set {
                setProperty("chOff", value);
            }
        }

        public JSString vAlign {
            get {
                return getProperty<JSString>("vAlign");
            }
            set {
                setProperty("vAlign", value);
            }
        }

        public HTMLElement insertCell(JSNumber index) {
            return callFunction<HTMLElement>("insertCell", index);
        }

        public void deleteCell(JSNumber index) {
            callProcedure("deleteCell", index);
        }

    }

    [Tag("TD")]
    public class HTMLTableCellElement: HTMLElement {
        public HTMLTableCellElement(JSVar src)
            : base(src) {
        }

        public JSNumber cellIndex {
            get {
                return getProperty<JSNumber>("cellIndex");
            }
        }

        public JSString abbr {
            get {
                return getProperty<JSString>("abbr");
            }
            set {
                setProperty("abbr", value);
            }
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString axis {
            get {
                return getProperty<JSString>("axis");
            }
            set {
                setProperty("axis", value);
            }
        }

        public JSString bgColor {
            get {
                return getProperty<JSString>("bgColor");
            }
            set {
                setProperty("bgColor", value);
            }
        }

        public JSString ch {
            get {
                return getProperty<JSString>("ch");
            }
            set {
                setProperty("ch", value);
            }
        }

        public JSString chOff {
            get {
                return getProperty<JSString>("chOff");
            }
            set {
                setProperty("chOff", value);
            }
        }

        public JSNumber colSpan {
            get {
                return getProperty<JSNumber>("colSpan");
            }
            set {
                setProperty("colSpan", value);
            }
        }

        public JSString headers {
            get {
                return getProperty<JSString>("headers");
            }
            set {
                setProperty("headers", value);
            }
        }

        public JSString height {
            get {
                return getProperty<JSString>("height");
            }
            set {
                setProperty("height", value);
            }
        }

        public JSBoolean noWrap {
            get {
                return getProperty<JSBoolean>("noWrap");
            }
            set {
                setProperty("noWrap", value);
            }
        }

        public JSNumber rowSpan {
            get {
                return getProperty<JSNumber>("rowSpan");
            }
            set {
                setProperty("rowSpan", value);
            }
        }

        public JSString scope {
            get {
                return getProperty<JSString>("scope");
            }
            set {
                setProperty("scope", value);
            }
        }

        public JSString vAlign {
            get {
                return getProperty<JSString>("vAlign");
            }
            set {
                setProperty("vAlign", value);
            }
        }

        public JSNumber width {
            get {
                return getProperty<JSNumber>("width");
            }
            set {
                setProperty("width", value);
            }
        }
    }

    [Tag("FRAMESET")]
    public class HTMLFrameSetElement: HTMLElement {
        public HTMLFrameSetElement(JSVar src)
            : base(src) {
        }

        public JSString cols {
            get {
                return getProperty<JSString>("cols");
            }
            set {
                setProperty("cols", value);
            }
        }
        public JSString rows {
            get {
                return getProperty<JSString>("rows");
            }
            set {
                setProperty("rows", value);
            }
        }
    }

    [Tag("FRAME")]
    public class HTMLFrameElement: HTMLElement {
        public HTMLFrameElement(JSVar src)
            : base(src) {
        }

        public JSString frameBorder {
            get {
                return getProperty<JSString>("frameBorder");
            }
            set {
                setProperty("frameBorder", value);
            }
        }

        public JSString longDesc {
            get {
                return getProperty<JSString>("longDesc");
            }
            set {
                setProperty("longDesc", value);
            }
        }

        public JSString marginHeight {
            get {
                return getProperty<JSString>("marginHeight");
            }
            set {
                setProperty("marginHeight", value);
            }
        }

        public JSString marginWidth {
            get {
                return getProperty<JSString>("marginWidth");
            }
            set {
                setProperty("marginWidth", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSBoolean noResize {
            get {
                return getProperty<JSBoolean>("noResize");
            }
            set {
                setProperty("noResize", value);
            }
        }

        public JSString scrolling {
            get {
                return getProperty<JSString>("scrolling");
            }
            set {
                setProperty("scrolling", value);
            }
        }

        public JSString src {
            get {
                return getProperty<JSString>("src");
            }
            set {
                setProperty("src", value);
            }
        }

        public Document contentDocument {
            get {
                return getProperty<Document>("contentDocument");
            }
        }
    }

    [Tag("IFRAME")]
    public class HTMLIFrameElement: HTMLElement {
        public HTMLIFrameElement(JSVar src)
            : base(src) {
        }

        public JSString align {
            get {
                return getProperty<JSString>("align");
            }
            set {
                setProperty("align", value);
            }
        }

        public JSString frameBorder {
            get {
                return getProperty<JSString>("frameBorder");
            }
            set {
                setProperty("frameBorder", value);
            }
        }

        public JSString height {
            get {
                return getProperty<JSString>("height");
            }
            set {
                setProperty("height", value);
            }
        }

        public JSString longDesc {
            get {
                return getProperty<JSString>("longDesc");
            }
            set {
                setProperty("longDesc", value);
            }
        }

        public JSString marginHeight {
            get {
                return getProperty<JSString>("marginHeight");
            }
            set {
                setProperty("marginHeight", value);
            }
        }

        public JSString marginWidth {
            get {
                return getProperty<JSString>("marginWidth");
            }
            set {
                setProperty("marginWidth", value);
            }
        }

        public JSString name {
            get {
                return getProperty<JSString>("name");
            }
            set {
                setProperty("name", value);
            }
        }

        public JSString scrolling {
            get {
                return getProperty<JSString>("scrolling");
            }
            set {
                setProperty("scrolling", value);
            }
        }

        public JSString src {
            get {
                return getProperty<JSString>("src");
            }
            set {
                setProperty("src", value);
            }
        }

        public JSString width {
            get {
                return getProperty<JSString>("width");
            }
            set {
                setProperty("width", value);
            }
        }

        public Document contentDocument {
            get {
                return getProperty<Document>("contentDocument");
            }
        }
    }
}
